//
//  ErWeiMa.m
//  YYPHSpeedJump
//
//  Created by sujiang on 16/1/11.
//  Copyright © 2016年 sujiang. All rights reserved.
//

#import "ErWeiMa.h"

@implementation ErWeiMa

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self addSubviews];
    }
    return self;
}

- (void)addSubviews
{
    self.layer.cornerRadius = 5;
    self.layer.masksToBounds = YES;
    self.backgroundColor = kColors(231, 231, 231, 1);
    UILabel *lable = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.width, 39)];
    lable.text = @"扫描二维码关注官方微信微博获取邀请码";
    lable.font = [UIFont systemFontOfSize:14];
    [self addSubview:lable];
    lable.textColor = kColors(102, 102, 102, 1);
    lable.textAlignment = NSTextAlignmentCenter;
    lable.backgroundColor = kColors(255, 255, 255, 1);
    
    self.aView = [[UIView alloc] initWithFrame:CGRectMake(0, lable.bottom + 1, self.width, self.height - lable.bottom - 1)];
    self.aView.backgroundColor = kColors(255, 255, 255, 1);
    [self addSubview:self.aView];
    self.wxImageView = [[UIImageView alloc] initWithFrame:CGRectMake(37, 11, 103 *kWidthScale, 103 *kWidthScale)];
    self.wxImageView.image = [UIImage imageNamed:@"微信二维码"];
    [self.aView addSubview:self.wxImageView];
    UILabel *wx = [[UILabel alloc] initWithFrame:CGRectMake(self.wxImageView.left + (self.wxImageView.width - 60) / 2, self.wxImageView.bottom + 5, 60, 12)];
    self.wxImageView.userInteractionEnabled = YES;
    wx.textAlignment = NSTextAlignmentCenter;
    wx.textColor = kColors(102, 102, 102, 1);
    wx.text = @"微信二维码";
    wx.font = [UIFont systemFontOfSize:12];
    [self.aView addSubview:wx];
    
    self.wbImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.width - 37 - 103 *kWidthScale, self.wxImageView.top, 103 *kWidthScale, 103 *kWidthScale)];
    self.wbImageView.image = [UIImage imageNamed:@"微博二维码"];
    [self.aView addSubview:self.wbImageView];
    self.wbImageView.userInteractionEnabled = YES;
    UILabel *wb = [[UILabel alloc] initWithFrame:CGRectMake(self.wbImageView.left + (self.wbImageView.width - 60) / 2, self.wbImageView.bottom + 5, 60, 12)];
    wb.textAlignment = NSTextAlignmentCenter;
    wb.textColor = kColors(102, 102, 102, 1);
    wb.text = @"微博二维码";
    wb.font = [UIFont systemFontOfSize:12];
    [self.aView addSubview:wb];
    
    self.backBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    self.backBtn.frame = CGRectMake((self.width - 100) / 2, wx.bottom + 5, 100 *kWidthScale, 30 *kHeightScale);
    [self.backBtn setBackgroundImage:[UIImage imageNamed:@"back"] forState:(UIControlStateNormal)];
    [self.aView addSubview:self.backBtn];
    
    
}

@end
